package com.hjw.exer2;

/**
 * 客人
 * @author hjwStrart
 * @create 2022-01-11 15:11
 */

public class Guest {
    private String[] dishNames;//用于存储客人点的菜名
    /**
     * 客人输入菜名点餐，返回菜单
     * @param foods  菜名
     * @return   null出错了，String[]菜单
     */
    public void order(Food[] foods){

        if (foods == null)
            return;
         dishNames = new String[foods.length];
        for (int i = 0; i < foods.length; i++) {
            dishNames[i] = foods[i].getFoodName();
        }
    }

    public String[] getDishNames() {
        return dishNames;
    }
}
